import React, { Component } from 'react'
import {withRouter}  from "react-router-dom"
import style from "./dongtai.module.css"
import aaa  from "./photo/aaa.jpg"
import axios from "axios"
 class index extends Component {
    state={
        idx:false,
        data:[]
    }
    push=()=>{
        console.log(this.props.history,"aaa")
        this.props.history.push("/details")
        this.setState({
            
        })
    }
    componentDidMount() {
        this.bbb()
    }
    bbb() {
        const headerJSON = {
            "Content-Type": "application/json;charset=UTF-8"
        };
        axios({
            url: "/dongtai/bdc/selectBDC1",
            method: 'post',
            data: {
            },
            headers: headerJSON,
        }).then(res => {
            // this.state.data= res.data
            this.setState({
           
               data:res.data
            })
            console.log(this.state.data,"aaa")
        })

    }
    render() {  
        return (
            
            <div>
                <div className={style.main}> 
                <span className={style.span}>全部</span> 
                <div className={style.maps}>
                {   this.state.data.map((item,i)=>
                <div className={style.logs}>
                <div className={style.list}>
                    <div className={style.listcon}>
                    <p>{item.dtime}</p>
                    <div>
                        <div className={style.pic}>
                            <img src={aaa}/>     
                        </div>
                        <div className={style.item}>
                            <div className={style.set}>{item.dheadline}</div>
                            {
                                !this.state.idx&&<button onClick={()=>{
                                    this.state.idx=!this.state.idx
                                    this.setState({})
                                }}>订阅动态</button>
                            }
                            {
                                this.state.idx&&<button onClick={()=>{
                                    this.state.idx=!this.state.idx
                                    this.setState({})
                                }}>已订阅动态</button>
                            }
                        </div>
                        <div className={style.content}>
                            无论从建筑空间的研究，还是建筑与自然，与人的关系，红树林都算是度假行业里面的集大成者，它的设计规划和运营模式或将成为未来的发展趋势。
                       
                        </div>
                        
                    </div>
                 
                    </div>
                    
                </div>
               </div>
                )
    }
</div>


                    </div>   
            </div>
        )
    }
}
export default withRouter(index)
